package com.xmy.study.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xmy.study.entity.AuthAdminContent;
import com.xmy.study.entity.ChaPlan;
import com.xmy.study.entity.StoreData;
import org.apache.ibatis.annotations.Param;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface IChaPlanService extends IService<ChaPlan> {
    /**
     * 获取通关率
     *
     * @param wrapper
     * @return
     */
    List<ChaPlan> getClearanceRateChaPlan(Wrapper wrapper);

    IPage<ChaPlan> getChaPanAddList(IPage<?> iPage,
                                    String schoolIdStr,
                                    String yearPart,
                                    String quarterNum,
                                    String teacherId,
                                    String gradeId,
                                    String yearClassId,
                                    String gradeSection,
                                    String classTypeId,
                                    String lessonNum,
                                    String status,
                                    String studentName,
                                    String subjectId,
                                    String count,
                                    Integer taskCategoryId);

    List<ChaPlan> getPassRadeList(String yearPart,
                                  String quarterNum,
                                  String schoolIdStr,
                                  String yearClassIdStr,
                                  String type,
                                  String lessonNumStart,
                                  String lessonNum,
                                  String classTypeId,
                                  String readingType,
                                  String readingStatusStr,
                                  String isBeforQuarter,
                                  String passDate,
                                  String passDateStart,
                                  String passDateEnd,
                                  String subjectId,
                                  String rightNumStartDate,
                                  String rightNumEndDate,
                                  String trackId,
                                  Integer isYearClass,
                                  String radeType,
                                  String listState,
                                  String teacherId,
                                  String name,
                                  String classify,
                                  String trackType,
                                  String teamId,
                                  String include,
                                  String inType,
                                  Integer taskCategoryId,
                                  String isAchieve,
                                  String moldType,
                                  String courseSchedulingDetailName,
                                  String examSchedulingtType,
                                  String leadSchoolIds,
                                  String leadSubjectsIds,
                                  String leadYearClassIds,
                                  Long leadTeacherId,
                                  Integer isIncludeFirstCourse
    );

    IPage<ChaPlan> getPassRadeDetail(IPage<?> iPage,
                                     String yearPart,
                                     String quarterNum,
                                     String schoolIdStr,
                                     String teacherId,
                                     String yearClassIdStr,
                                     String type,
                                     String gradeId,
                                     String lessonNumStart,
                                     String lessonNum,
                                     String classTypeId,
                                     String readingType,
                                     String readingStatusStr,
                                     String isBeforQuarter,
                                     String passType,
                                     String courseVersionId,
                                     String passDate,
                                     String passDateStart,
                                     String passDateEnd,
                                     String subjectsId,
                                     String rightNumStartDate,
                                     String rightNumEndDate,
                                     String studentName,
                                     String radeType,
                                     String listState,
                                     String classify,
                                     String trackType,
                                     String teamId,
                                     String include,
                                     String inType,
                                     Integer taskCategoryId,
                                     String courseSchedulingDetailName,
                                     String studentIdStr,
                                     String moldType,
                                     String examSchedulingtType,
                                     String leadSchoolIds,
                                     String leadSubjectsIds,
                                     String leadYearClassIds,
                                     Long leadTeacherId,
                                     Integer isIncludeFirstCourse
    );

    ChaPlan getPassRadeDetailTotal(String yearPart,
                                   String quarterNum,
                                   String schoolIdStr,
                                   String teacherId,
                                   String yearClassIdStr,
                                   String type,
                                   String gradeId,
                                   String lessonNumStart,
                                   String lessonNum,
                                   String classTypeId,
                                   String readingType,
                                   String readingStatusStr,
                                   String isBeforQuarter,
                                   String passType,
                                   String courseVersionId,
                                   String passDate,
                                   String passDateStart,
                                   String passDateEnd,
                                   String subjectsId,
                                   String rightNumStartDate,
                                   String rightNumEndDate,
                                   String studentName,
                                   String radeType,
                                   String include,
                                   String inType,
                                   Integer taskCategoryId);

    List<ChaPlan> getPassRadeDetailForStudentId(String yearPart, String quarterNum, String studentId, String subjectsId, Integer taskCategoryId, String yetLessonNumStr);

    boolean addChaPlan(ChaPlan chaPlan);

    List<ChaPlan> getNeedOrder(Integer yearPart,
                               Integer quarterNum,
                               Long schoolId,
                               Integer yearClassId,
                               Long classTypeId,
                               Long subjectsId,
                               Integer lessonType,
                               Long goodsTypeId,
                               Integer startLessonNum,
                               Integer endLessonNum,
                               Integer taskCategoryId);

    IPage<StoreData> getNeedOrderForGroup(
            IPage<?> page,
            Integer yearPart,
            Integer quarterNum,
            Long schoolId,
            Integer yearClassId,
            Long classTypeId,
            Long subjectsId,
            Integer lessonType,
            Long goodsTypeId,
            Integer startLessonNum,
            Integer endLessonNum,
            Integer taskCategoryId);

    String getChaPlanLessonNumString(ChaPlan chaPlan);

    /**
     * 获取荣誉列表
     */
    public List<ChaPlan> getHonorList(String yearPart,
                                      String quarterNum,
                                      String schoolIdStr,
                                      String yearClassIdStr,
                                      String type,
                                      String lessonNumStart,
                                      String lessonNumEnd,
                                      String classTypeId,
                                      String readingType,
                                      String subjectsId,
                                      String isBeforQuarter,
                                      String trackId,
                                      String teacherId,
                                      String name,
                                      String include,
                                      Integer taskCategoryId,
                                      String classify,
                                      String trackType,
                                      String teamId,
                                      String startDate,
                                      String endDate
    );

    /**
     * 获取荣誉详情
     */
    public IPage<ChaPlan> getHonorDetails(IPage<?> iPage,
                                          String yearPart,
                                          String quarterNum,
                                          String schoolIdStr,
                                          String yearClassIdStr,
                                          String type,
                                          String lessonNumStart,
                                          String lessonNumEnd,
                                          String classTypeId,
                                          String readingType,
                                          String subjectsId,
                                          String isBeforQuarter,
                                          String trackId,
                                          String teacherId,
                                          String name,
                                          String include,
                                          Integer taskCategoryId,
                                          String passType,
                                          String classify,
                                          String trackType,
                                          String teamId,
                                          String gradeId,
                                          String startDate,
                                          String endDate
    );

    /**
     * 获取数学积分列表
     */
    public List<ChaPlan> getPassRadeIntegralList(String yearPart,
                                                 String quarterNum,
                                                 String schoolId,
                                                 String teacherId,
                                                 String yearClassId,
                                                 Long subjectsId,
                                                 String classTypeId,
                                                 String readingType,
                                                 Long courseVersionId,
                                                 String isBeforQuarter,
                                                 String include,
                                                 String taskCategoryId,
                                                 String classify,
                                                 String trackType,
                                                 String teamId,
                                                 String lessonNumStart,
                                                 String lessonNumEnd,
                                                 String startDate,
                                                 String endDate,
                                                 String type,
                                                 String inType,// 1、全部，2已录
                                                 String listState,
                                                 String moldType  // 1、正确率，2、通关率，3、费曼学习积分
    );

    /**
     * 获取数学积分详情
     */
    public IPage<ChaPlan> getPassRadeIntegralDetail(IPage<?> page,
                                                    String yearPart,
                                                    String quarterNum,
                                                    String schoolId,
                                                    String teacherId,
                                                    String studentId,
                                                    String yearClassId,
                                                    Long subjectsId,
                                                    String gradeId,
                                                    String classTypeId,
                                                    String readingType,
                                                    Long courseVersionId,
                                                    String isBeforQuarter,
                                                    String studentName,
                                                    String include,
                                                    String taskCategoryId,
                                                    String classify,
                                                    String trackType,
                                                    String teamId,
                                                    String lessonNumStart,
                                                    String lessonNumEnd,
                                                    String startDate,
                                                    String endDate,
                                                    String type,
                                                    String inType,
                                                    String moldType,  // 1、正确率，2、通关率，3、费曼学习积分
                                                    String listState
    );

    public IPage<ChaPlan> getChaPanIntegralAddList(IPage<?> page,
                                                   String yearPart,
                                                   String quarterNum,
                                                   String schoolId,
                                                   String teacherId,
                                                   String gradeId,
                                                   String yearClassId,
                                                   String classTypeId,
                                                   String lessonNum,
                                                   String studentName,
                                                   Long subjectsId,
                                                   Long courseVersionId,
                                                   String brushCount,
                                                   Integer taskCategoryId);

    boolean addChaPanIntegra(ChaPlan chaPlan);

    @Async
    void updatePassLesson(Integer yearPart, Integer quarterNum);
}
